//
//  LBDakaDetailVC.m
//  V-Learn
//
//  Created by Apple on 2019/1/2.
//  Copyright © 2019 yxk. All rights reserved.
//

#import "LBDakaDetailVC.h"
#import "LBDakaCell.h"
@interface LBDakaDetailVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UIButton *followBtn;
@property (nonatomic, strong) UIButton *zanButton;
@end

@implementation LBDakaDetailVC
- (UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, ScreenW, ScreenH-64-44) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
    }
    return _tableView;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //    self.navigationItem.title = @"牛娃详情";
    [self setupUI];
}
- (void)setupUI{
    
    self.navigationItem.title = self.titleString;

    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 200;
    

    [self.view addSubview:self.tableView];
    
    UIView *bottomView = [UIView new];
    [self.view addSubview:bottomView];
    bottomView.backgroundColor = [UIColor whiteColor];
    [bottomView makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(44*kScaleFit);
    }];
    //中间线
    UIView *lineView = [UIView new];
    [bottomView addSubview:lineView];
    lineView.backgroundColor = rgb(195,195,195);
    [lineView makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(bottomView);
        make.centerX.mas_equalTo(bottomView);
        make.size.mas_equalTo(CGSizeMake(1*kScaleFit, 24*kScaleFit));
    }];
    
    //赞
    self.zanButton = [[UIButton alloc] init];
    [bottomView addSubview:self.zanButton];
    [self.zanButton setTitle:@"2019" forState:UIControlStateNormal];
    [self.zanButton setTitleColor:rgb(102,102,102) forState:UIControlStateNormal];
    [self.zanButton setImage:LBImage(@"wk_Fabulous") forState:UIControlStateSelected];
    [self.zanButton setImage:LBImage(@"wk_unFabulous") forState:UIControlStateNormal];
    
    self.zanButton.titleLabel.font = LBFont(12*kScaleFit);
    [self.zanButton makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.mas_equalTo(0*kScaleFit);
        make.width.mas_equalTo(ScreenW/2);
    }];
    [self.zanButton addTarget:self action:@selector(clickZanBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    //关注
    self.followBtn = [[UIButton alloc] init];
    [bottomView addSubview:self.followBtn];
    [self.followBtn setTitle:@"关注" forState:UIControlStateNormal];
    [self.followBtn setTitleColor:rgb(233,84,18) forState:UIControlStateNormal];
    [self.followBtn setImage:LBImage(@"wk_Fabulous") forState:UIControlStateSelected];
    [self.followBtn setImage:LBImage(@"wk_unFabulous") forState:UIControlStateNormal];
    
    self.followBtn.titleLabel.font = LBFont(12*kScaleFit);
    [self.followBtn makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.mas_equalTo(0*kScaleFit);
        make.width.mas_equalTo(ScreenW/2);
    }];
    [self.followBtn addTarget:self action:@selector(clickFollowBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    
}
#pragma mark - 关注
- (void)clickFollowBtn:(UIButton *)sender{
    
}
#pragma mark - 点赞
- (void)clickZanBtn:(UIButton *)sender{
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LBDakaCell *cell = [LBDakaCell cellWithTableView:tableView];
    return cell;
}


@end
